home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF-Interest Archive / June 96 / Coercion Woes < prev    next >
Encoding:
Internet Message Format  |  1996-12-03  |  1.6 KB  |  [TEXT/ttxt]

  1. Subject:     Coercion Woes
  2. Sent:        6/24/96 12:09 AM
  3. Received:    6/24/96 8:25 AM
  4. From:        Hutchings Software Development, hsd@earthlink.net
  5. Reply-To:    ODF Interest, ODF-Interest@CILabs.ORG
  6. To:          OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
  7.  
  8. OK, so I installed my own coercion function using FW_CSemanticInterface.
  9. Then, within my code, I call:
  10.  
  11.     result_desc.CoerceInPlace(kClass_RIPoint);
  12.  
  13. where result_desc is a FW_CDesc representing a perfectly good descriptor
  14. obtained from ::OSACoerceToDesc (I've walked through that code and know it
  15. works), and kClass_RIPoint is an AppleScript class defined in my 'aete'.
  16.  
  17. Problem is, my coercion handler does not get called. So, I stepped through
  18. the debug version of OpenDoc 1.0.4 into
  19. ODMessageInterface::HandleAllCoercionsAux, where I found the line:
  20.  
  21.     ODPart*    contextPart = _fNameResolver->GetCurrentContextPart(ev);
  22.  
  23. And sure enough, context_part == kODNULL after stepping over it.
  24. Unfortunately, there are no public methods for setting the current context
  25. part.
  26.  
  27.  
  28. So, I guess there are two problems/questions here...
  29.  
  30. (1)    Should OpenDoc provide support for parts which want to use the
  31.     Apple Event Manager to do coersions when the part is not involved
  32.     in OSL protocol?
  33.  
  34. (2)    With ODF, should FW_CDesc::CoerceInPlace optionally take a
  35.     FW_CSemanticInterface parameter so in-part coercions can be
  36.     dispatched directly? Or should I just be calling my coercion
  37.     proc directly (which actually looks like a good idea now that
  38.     I've typed up my problem!)?
  39.  
  40. Thanks,
  41.  
  42. Brad
  43.  
  44.  
  45.  
  46.  
  47. Richard B. "Brad" Hutchings
  48. General Partner,
  49. Hutchings Software Development
  50.  
  51. hsd@earthlink.net
  52.